Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os: Add proper process termination in Linux #20671

Merged
merged 10 commits into from
Jan 27, 2024

Conversation

SewerynKaminski
Copy link
Contributor

There is only signal_kill() option to terminate a process wich is not working.
The proper way is to send TERM signal.

@spytheman spytheman added os.Process Bugs related to the os.Process implementation Bug This tag is applied to issues which reports bugs. labels Jan 27, 2024
@spytheman spytheman assigned spytheman and unassigned spytheman Jan 27, 2024
@spytheman
Copy link
Member

You have to also add shims for unix_kill_process to vlib/os/process_windows.c.v, and then v fmt -w vlib/os .

@spytheman spytheman marked this pull request as draft January 27, 2024 10:12
@SewerynKaminski SewerynKaminski marked this pull request as ready for review January 27, 2024 10:13
@spytheman
Copy link
Member

A shim for unix_term_process should be also added to vlib/os/process_windows.c.v, and a shim for win_term_process should be also added to vlib/os/process_nix.c.v. See the bottom of those files.

The current implementation is a bit convoluted, but it is needed to make the generation of the vc/v.c and vc/v_win.c (bootstrapping) reliable.

@SewerynKaminski
Copy link
Contributor Author

OK. I missed it :) Corrected.

vlib/os/process.c.v Outdated Show resolved Hide resolved
Fix returns
@SewerynKaminski SewerynKaminski marked this pull request as draft January 27, 2024 19:44
@SewerynKaminski SewerynKaminski marked this pull request as ready for review January 27, 2024 19:45
Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work.

@spytheman spytheman merged commit 5f7e6ff into vlang:master Jan 27, 2024
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs. os.Process Bugs related to the os.Process implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants